package com.jxrj.interaction.controller;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import javax.servlet.http.HttpSession;

public class BaseController {
    //log4j2
    protected Logger logger = LogManager.getLogger(BaseController.class);

    //获取教师信息
    protected Object checkTeacher(HttpSession session){
        Object o = session.getAttribute("teacherId");
        if(o==null){
            logger.info("教师未登录");
            return null;
        }
        logger.info("当前登录教师ID：{}",o);
        return o;
    }
}

